// import { homeStore } from 'base/store'
import { AppPage, PageBuilder } from '../base/AppPage'

interface PageData {
  hint: string | null,
}

class HomePage extends AppPage<'home', PageData> {
  public name: 'home' = 'home'

  public initData: Partial<PageData> = {
    hint: null
  }

  public onLoad(options: this['options']): void {
    // console.log(this.update)
    // 使用redirectTo是在当前页面打开
    // navigateTo相当于在新窗口打开
    // 如果页面被声明到了tabBar，则必须使用switchTab
    console.log('index page', arguments)
  }

  public onShow() {
    this.store.data.home.a = 100
    // this.update()
    this.store.update()
  }
}

PageBuilder.build(HomePage)
